/**
 * File    : TapestryComponentsModule.java
 * Created : 2008-10-18
 * By      : LuHuiguo
 */
package com.luhuiguo.tapestry.services;

import org.apache.tapestry5.ioc.Configuration;
import org.apache.tapestry5.ioc.MappedConfiguration;
import org.apache.tapestry5.ioc.ServiceBinder;
import org.apache.tapestry5.services.BindingFactory;
import org.apache.tapestry5.services.BindingSource;
import org.apache.tapestry5.services.LibraryMapping;

import com.luhuiguo.tapestry.bindings.MessageFormatBindingFactory;

/**
 * @author LuHuiguo
 * @version $Id: TapestryComponentsModule.java 10 2008-10-18 14:36:00Z LuHuiguo
 *          $
 * 
 */
public class TapestryComponentsModule {

	public static void bind(ServiceBinder binder) {
	}

	public static void contributeComponentClassResolver(
			final Configuration<LibraryMapping> configuration) {
		configuration.add(new LibraryMapping("", "com.luhuiguo.tapestry"));
		configuration.add(new LibraryMapping("tc", "com.luhuiguo.tapestry"));
		configuration.add(new LibraryMapping("lhg", "com.luhuiguo.tapestry"));
	}

	public static void contributeBindingSource(
			MappedConfiguration<String, BindingFactory> configuration,
			BindingSource bindingSource) {
		configuration.add("messageformat", new MessageFormatBindingFactory(
				bindingSource));

	}

}
